
import util from '../../../common/js/util'
import NProgress from 'nprogress'
import axios from 'axios';
import address from "../../../../models/dict/address.js"  //任务字典模块
import moment from 'moment'

import task from "../../../../models/dict/task.js"  //任务字典模块
import array from "../../../../models/comm/array.js"  //数组操作模块
import yz from "../../../../models/comm/yz.js"  //数组操作模块
import Vue from 'vue'

import math from 'mathjs';




export default {
    data() {
        return {



            unitArray: task.unitArray(),

            listLoading: false,
            amount: 0



        }
    },
    methods: {
        settlementStatusArray() {
            return task.settlementStatusArray();

        },

        getDateStr(date) {
            return moment(date).format("YYYY-MM-DD HH:mm");

        },

        addDetail(settlementClass) {
            var item = task.fmtDetailItem({}, this.currObj.taskClassId)
            item.name = settlementClass.name
            if (settlementClass.id == 'zdy') {
                //如果选择了自定义

                item.name = "";
            }

            item.sendMemberId = sessionStorage.memberId;
            item.sendMemberName = sessionStorage.name




            this.currObj.detail.push(item);

        },

        fmtTask: function () {


            task.fmtTask(this.currObj);
        },
        delDetal(row, index) {


            this.currObj.detail.splice(index, 1);
        },
        getSettlementStatusName(statusId) {
            return task.getSettlementStatusName(statusId)

        },
        getSendMemberName() {


            return sessionStorage.name;
        },
        getSettlementClassArray() {
            return task.settlementClassArray()
        }




    },
    props: {
        currObj: {

        }


    }
}